from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeyEvent

from ui.gbq.ui.BaseWidget import BaseWidge


class BaseDiaWidget(BaseWidge):

    def __init__(self, parent=None):
        super(BaseDiaWidget, self).__init__(parent)

    def keyPressEvent(self, QKeyEvent: QKeyEvent):
        # esc退出
        if QKeyEvent.key() == Qt.Key_Escape:
            self.close()
